let DBserve = require("../NEDB/index");

const chatserver = {
  // 新增记录
  Add: (data) =>
    DBserve({
      DBname: "chathistory",
      order: "insert",
      option: data,
    }),
  // 查询记录列表
  List: (data) =>
    DBserve({
      DBname: "chathistory",
      order: "find",
      option: data,
    }),
  // 查询记录
  Get: (data) =>
    DBserve({
      DBname: "chathistory",
      order: "findOne",
      option: data,
    }),
  // 修改记录
  Upt: (data) =>
    DBserve({
      DBname: "chathistory",
      order: "update",
      option: data,
    }),
  // 删除记录
  Del: (data) =>
    DBserve({
      DBname: "chathistory",
      order: "remove",
      option: data,
    }),
};
module.exports = chatserver;
